/**
 * 启动
 * @param ip 服务器ip
 * @param projectName 检测项目是否存活的项目名
 * @param java java path
 * @param realProjectName  真正的项目名
 * @param localConfigPath 本地配置文件路径
 */
void  call(String ip , String remotePath , String javaOps, String  catalinaOps, String javaHome) {
    String filePath="${remotePath}bin/setenv.sh"
    withCredentials([sshUserPrivateKey(
            credentialsId: 'ssh_key',  // 凭证 ID
            keyFileVariable: 'SSH_KEY',
            usernameVariable: 'USER'
    )]) {
        ssh.sshVoid(ip, "rm -f ${filePath}")
        ssh.sshVoid(ip, "echo '\" JAVA_OPTS=\\\"${javaOps}\\\"\"' >> ${filePath}")
        ssh.sshVoid(ip, "echo '\" JAVA_HOME=\\\"${javaHome}\\\"\"' >> ${filePath}")
        ssh.sshVoid(ip, "echo '\" CATALINA_OPTS=\\\"'\$CATALINA_OPTS'  ${catalinaOps} \\\"\"' >> ${filePath}")
    }
}
